package diona.snippet

import net.liftweb.util.Helpers._
import xml.NodeSeq
import diona.model.{User, ImageInfo}

class ImageList {

  def images(in: NodeSeq): NodeSeq = {
    ImageInfo.byUser(User.currentUser.get).flatMap(
    {
      i => {
        val ref = "/imageViewer/image/" + i.id + ".jpg"
        bind("im", in, AttrBindParam("href", ref, "href"), AttrBindParam("src", ref, "src"))
      }
    }
    )
  }
}